import Http from 'utils/request'

const context = process.env.VUE_APP_CONSOLE_PATH

const API = {
  carTypeList: '/car/carTypeList', // 车型列表,
  carTypeDel: '/car/carTypeDel', // 删除车型,
  carTypeSave: '/car/carTypeSave', // 新增车型
  carTypeEdit: '/car/carTypeEdit', // 修改车型

  carMrgList: '/car/carMrgList', // 车辆列表
  carMrgSave: '/car/carMrgSave', // 新增车辆
  carMrgEdit: '/car/carMrgEdit', // 修改车辆

  carMrgRunList: '/car/carMrgRunList', // 获取车辆运营列表
  queryLastReturnCarImages: '/car/queryLastReturnCarImages', // 查看最后一次还车图片
  saveParkInfo: '/car/saveParkInfo', // 设置投放网点
  setReturnCarPark: '/car/setReturnCarPark', // 设置还车网点
  openTheDoor: '/car/openTheDoor', // 开门
  orderCar: '/car/orderCar', // 预约车辆
  carLocus: '/car/carLocus', // 车辆轨迹

  carRepairAdd: '/car/carRepairAdd', // 车辆维修
  carRepairList: '/car/carRepairList', // 维修列表
  carRepairEdit: '/car/carRepairEdit', // 修改维修信息

  dispatcherList: '/dispatcher/list', // 调度员列表
  insertDispatcher: '/dispatcher/insertDispatcher', // 新增调度员
  updateDispatcher: '/dispatcher/updateDispatcher', // 修改调度员
  queryDispatcherByCarNumber: '/dispatcher/queryDispatcherByCarNumber', // 修改调度员
  setDispatcher: '/car/setDispatcher', // 设置调度员
  queryDispatcherWithdraw: '/dispatcher/queryDispatcherWithdraw', // 查询提现列表
  auditWithdraw: '/dispatcher/auditWithdraw', // 提现审核
  queryDispatcherBankCard: '/dispatcher/queryDispatcherBankCard', // 查询车主银行卡
  uploadCertificates: '/dispatcher/uploadCertificates', // 上传打款凭证
  dispatcherStatistics: '/dispatcher/dispatcherStatistics', // 车主统计
  queryDispatcherCarEarnings: '/dispatcher/queryDispatcherCarEarnings' // 车主收益明细
}

/**
 * 通用接口请求方法
 * @param {*} param
 */
/**
 * 通用接口请求方法
 * @param {*} param
 */
export const fetch = (url, param = {}, opt = {}) => Http.fetch(context + API[url], param, opt)
